package designparttendemo2;


import designparttendemo2.observer.UserEventObserver1;
import designparttendemo2.observer.UserEventObserver3;
import designparttendemo2.observer.UserEventPublisher;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan("designparttendemo2.observer")
public class DesignParttenDemo2Application {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext configApplicationContext = new AnnotationConfigApplicationContext(DesignParttenDemo2Application.class);
//        for (String beanDefinitionName : configApplicationContext.getBeanDefinitionNames()) {
//            System.out.println(beanDefinitionName);
//        }
        UserEventPublisher userEventPublisher = configApplicationContext.getBean(UserEventPublisher.class);
        //UserEventObserver3 userEventObserver3 = new UserEventObserver3();
        userEventPublisher.register("hello");
    }

}
